﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<VietImage.Models.Image>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Tìm kiếm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <div>

        <div id="direction" style="width:400px; padding-top:15px;">
            <div class="right-arrow"></div>
            <div style="font-size:14px; float:left;"><%= Html.ActionLink("TÌM KIẾM","Index","Search") %></div>
        </div>
    </div>

    <div id="searchPanel" style="width:900px; margin-left:64px; margin-top:50px;">
        <form id="advancedsearch" name="advancedsearch" method="post" action="<%= Url.Action("Advanced","Search") %>">
                        <input type="hidden" id="sImgName" name="sImgName" value="false" />
                        <input type="hidden" id="sCreatedTime" name="sCreatedTime" value="false" />
                        <input type="hidden" id="sAuthor" name="sAuthor" value="false" />
                        <input type="hidden" id="sCategory" name="sCategory" value="false" />
                        <input type="hidden" id="sCountry" name="sCountry" value="false" />
                        <input type="hidden" id="sCity" name="sCity" value="false" />
            <table cellpadding="0" cellspacing="0" width="100%" style="min-width:800px;">
                <tr style="height:15px;">
                    <td class="left-top-border-panel-searchoption"></td>
                    <td class="top-border-panel-searchoption"></td>
                    <td class="right-top-border-panel-searchoption"></td>
                </tr>
                <tr>
                    <td class="left-border-panel-searchoption"></td>
                    <td class="center-panel-searchoption">
                    
                        <div>
                            <div style="vertical-align:middle;">
                                <div style="float:left; width:50%">
                                    <div style="padding:10px;">
                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbImgName"></div><div class="checked" id="cdImgName" style="margin-top:-16px; <%= ((bool)ViewData["sImgName"])? "":"display: none;" %>"></div></td>
                                                <td style="width:70px;">Tên ảnh</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="<%= (ViewData["ImgName"] != "")?ViewData["ImgName"]:"Từ khóa ..." %>" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtImgName" type="text" class="textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCreatedTime"></div><div class="checked" id="cdCreatedTime" style="margin-top:-16px; <%= ((bool)ViewData["sCreatedTime"])? "":"display: none;" %>"></div></td>
                                                <td style="width:70px;">Ngày đăng</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="<%= (ViewData["CreatedTime"] != "")?ViewData["CreatedTime"]:"Từ khóa ..." %>" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCreatedTime" type="text" class="search-textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbAuthor"></div><div class="checked" id="cdAuthor" style="margin-top:-16px; <%= ((bool)ViewData["sAuthor"])? "":"display: none;" %>"></div></td>
                                                <td style="width:70px;">Tên tác giả</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="<%= (ViewData["Author"] != "")?ViewData["Author"]:"Từ khóa ..." %>" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtAuthor" type="text" class="textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                </div>
                                <div style="float:left; width:50%">
                                     <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCategory"></div><div class="checked" id="cdCategory" style="margin-top:-16px; <%= ((bool)ViewData["sCategory"])? "":"display: none;" %>"></div></td>
                                                <td style="width:90px;">Tên chùm ảnh</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="<%= (ViewData["Category"] != "")?ViewData["Category"]:"Từ khóa ..." %>" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCategory" type="text" class="textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCountry"></div><div class="checked" id="cdCountry" style="margin-top:-16px; <%= ((bool)ViewData["sCountry"])? "":"display: none;" %>"></div></td>
                                                <td style="width:90px;">Quốc gia</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="<%= (ViewData["Country"] != "")?ViewData["Country"]:"Từ khóa ..." %>" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCountry" type="text" class="search-textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                    <div style="padding:10px;">

                                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                            <tr>
                                                <td style="width:20px;"><div class="checkbox" id="cbCity"></div><div class="checked" id="cdCity" style="margin-top:-16px; <%= ((bool)ViewData["sCity"])? "":"display: none;" %>"></div></td>
                                                <td style="width:90px;">Thành phố</td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" border="0">
	                                                    <tr class="tr-textbox">    
    	                                                    <td class="left-textbox"></td>
                                                            <td class="center-textbox"><input value="<%= (ViewData["City"] != "")?ViewData["City"]:"Từ khóa ..." %>" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtCity" type="text" class="search-textbox"/></td>
    	                                                    <td class="right-textbox"></td>    
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>                                        
                                        
                                    </div>
                                </div>                                                 
                            </div>

                            <div style="clear:both; max-width:50%; width:50%; float:left;">&nbsp;</div>
                            <div style="cursor:pointer; float:left;"  onmouseout="buttonmouseout('AdSearch');" onmousedown="buttonmousedown('AdSearch');" onmouseover="buttonmouseover('AdSearch');">
                                    <table cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td id="lbtnAdSearch" class="left-button"></td>
                                            <td id="mbtnAdSearch" class="middle-button"><span style="color:White;">TÌM KIẾM</span></td>
                                            <td id="rbtnAdSearch" class="right-button"></td>                        
                                        </tr>          
                                    </table>
                            </div>

                        </div>
                    
                    </td>
                    <td class="right-border-panel-searchoption"></td>
                </tr>
                <tr style="height:15px;">
                    <td class="left-bottom-border-panel-searchoption"></td>
                    <td class="bottom-border-panel-searchoption"></td>
                    <td class="right-bottom-border-panel-searchoption"></td>
                </tr>
            </table>
        </form>
    </div>

    <div id="Gallery" style="clear:both; width:1000px; position:relative; left:50%; margin-left:-500px; padding-top:30px; ">
        
        <div class="scrollbar2" style=" clear:both; width: 1000px; height:500px; margin-top:-10px;">
            <div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
            <div class="viewport" id="viewport" style="width: 1000px; height:500px; margin-top:50px;">

<% 
    VietImage.Models.Image img = new VietImage.Models.Image();
    Double h = ((Double)Model.Count / 2) + 0.5;
    int itemwidth = 200;
    int half = (int)h;
    half = 15;
%>
                <div class="overview" style="<%= "width:" + half * itemwidth + "px;" %>">

<% 
    for (int i = 0; i < Model.Count; )
    {
        img = Model[i++];
%>
                    <div style="float:left;">

                        <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel(<%= img.ID %>);" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(<%= img.ID %>)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                            </div>

<%
    if (i < Model.Count)
        {
            img = Model[i++];
%>
                        <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel(<%= img.ID %>);" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(<%= img.ID %>)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                            </div>
<%
        } 
%>
                    </div>
<%
    }
%>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" onclick="showaddtolightbox(0)" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>

                     <div style="float:left;">
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                       <div style="margin-left:10px; margin-right:10px;">
                            <div style="width:180px; height:250px;">                                
                                <div class="dotpanel" style="width:180px; height:180px;">
                                    <img src="/Content/Images/mediumnoimage.png" width="180px" height="180px" alt="" onclick="opendetailimagepanel();" style="cursor:pointer;"/>
                                </div>
                                <div style="margin-top:10px;">
                                    <div style="float:left"><%= img.ID.ToString() %></div><div class="plusbutton" style="float:right; margin-top:-5px; margin-right:-5px;"></div>
                                    <div style="clear:both;"><div class="downloadbutton" style="float:left;"></div><span><a>Fullsize</a> | <a>Smallsize</a> | <a>Thumbmail</a></span></div>
                                </div>
                            </div>
                        </div>
                    </div>




                </div>
            </div>
        </div>

    </div>


<script>
    $("#advancedsearch").submit(function () {
        $("#sImgName").val(!$("#cdImgName").is(":hidden"));
        $("#sCreatedTime").val(!$("#cdCreatedTime").is(":hidden"));
        $("#sAuthor").val(!$("#cdAuthor").is(":hidden"));
        $("#sCategory").val(!$("#cdCategory").is(":hidden"));
        $("#sCountry").val(!$("#cdCountry").is(":hidden"));
        $("#sCity").val(!$("#cdCity").is(":hidden"));
    });

</script>
</asp:Content>
